package com.javajun.entity;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.ManyToMany;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;

/**
 * @ClassName: MainGrade
 * @Description: 主修的主体
 * @author: xlm
 * @date: 2018年10月12日
 */
@Entity(name="xlm_maingrade")
public class MainGrade {
	private Integer id;
	// 分数
	private Integer grade;
	// 学生对象
	private Student student;
	// 课程对象
	private MainCourse mainCourse;
	
	@Id
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	public Integer getId() {
		return id;
	}
	public void setId(Integer id) {
		this.id = id;
	}
	public Integer getGrade() {
		return grade;
	}
	public void setGrade(Integer grade) {
		this.grade = grade;
	}
	@ManyToOne(fetch=FetchType.EAGER)
	public Student getStudent() {
		return student;
	}
	public void setStudent(Student student) {
		this.student = student;
	}
	@ManyToOne(fetch=FetchType.EAGER)
	public MainCourse getMainCourse() {
		return mainCourse;
	}
	public void setMainCourse(MainCourse mainCourse) {
		this.mainCourse = mainCourse;
	}
	
}
